///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun  5 2014)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "wx/wxprec.h"

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP

#include "BaseMainFrame.h"

///////////////////////////////////////////////////////////////////////////

BaseMainFrame::BaseMainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );

	m_mainMenu = new wxMenuBar( 0 );
	m_fileMenu = new wxMenu();
	wxMenuItem* m_menuFileNew;
	m_menuFileNew = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_NEW, wxString( wxT( "&New" ) ) + wxT( '\t' ) + wxT( "Ctrl+N" ), wxT( "Creates new file" ), wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuFileNew->SetBitmaps( wxArtProvider::GetBitmap( wxART_NEW, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileNew->SetBitmap( wxArtProvider::GetBitmap( wxART_NEW, wxART_MENU ) );
#endif
	m_fileMenu->Append( m_menuFileNew );

	m_fileMenu->AppendSeparator();

	wxMenuItem* m_menuFileOpen;
	m_menuFileOpen = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_OPEN, wxString( wxT( "&Open" ) ) + wxT( '\t' ) + wxT( "Ctrl+O" ), wxT( "Opens a file" ), wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuFileOpen->SetBitmaps( wxArtProvider::GetBitmap( wxART_FILE_OPEN, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileOpen->SetBitmap( wxArtProvider::GetBitmap( wxART_FILE_OPEN, wxART_MENU ) );
#endif
	m_fileMenu->Append( m_menuFileOpen );

	m_fileMenu->AppendSeparator();

	wxMenuItem* m_menuFileSave;
	m_menuFileSave = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_SAVE, wxString( wxT( "&Save" ) ) + wxT( '\t' ) + wxT( "Ctrl+S" ), wxT( "Saves a file" ), wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuFileSave->SetBitmaps( wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileSave->SetBitmap( wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_MENU ) );
#endif
	m_fileMenu->Append( m_menuFileSave );

	wxMenuItem* m_menuFileSaveAs;
	m_menuFileSaveAs = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_SAVE_AS, wxString( wxT( "SaveAs" ) ) , wxT( "Saves a file as" ), wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuFileSaveAs->SetBitmaps( wxArtProvider::GetBitmap( wxART_FILE_SAVE_AS, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileSaveAs->SetBitmap( wxArtProvider::GetBitmap( wxART_FILE_SAVE_AS, wxART_MENU ) );
#endif
	m_fileMenu->Append( m_menuFileSaveAs );

	m_fileMenu->AppendSeparator();

	wxMenuItem* m_menuFileClose;
	m_menuFileClose = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_CLOSE, wxString( wxT( "Close" ) ) , wxT( "Closes file" ), wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuFileClose->SetBitmaps( wxArtProvider::GetBitmap( wxART_CROSS_MARK, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileClose->SetBitmap( wxArtProvider::GetBitmap( wxART_CROSS_MARK, wxART_MENU ) );
#endif
	m_fileMenu->Append( m_menuFileClose );

	m_fileMenu->AppendSeparator();

	wxMenuItem* m_menuFileQuit;
	m_menuFileQuit = new wxMenuItem( m_fileMenu, MAIN_MENU_FILE_QUIT, wxString( wxT( "&Quit" ) ) + wxT( '\t' ) + wxT( "Alt+F4" ), wxT( "Quit the application" ), wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuFileQuit->SetBitmaps( wxArtProvider::GetBitmap( wxART_QUIT, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuFileQuit->SetBitmap( wxArtProvider::GetBitmap( wxART_QUIT, wxART_MENU ) );
#endif
	m_fileMenu->Append( m_menuFileQuit );

	m_mainMenu->Append( m_fileMenu, wxT( "&File" ) );

	m_editMenu = new wxMenu();
	wxMenuItem* m_menuUndo;
	m_menuUndo = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_UNDO, wxString( wxT( "&Undo" ) ) + wxT( '\t' ) + wxT( "Ctrl+Z" ), wxEmptyString, wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuUndo->SetBitmaps( wxArtProvider::GetBitmap( wxART_UNDO, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuUndo->SetBitmap( wxArtProvider::GetBitmap( wxART_UNDO, wxART_MENU ) );
#endif
	m_editMenu->Append( m_menuUndo );

	wxMenuItem* m_menuRedo;
	m_menuRedo = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_REDO, wxString( wxT( "Re&do" ) ) + wxT( '\t' ) + wxT( "Ctrl+Y" ), wxEmptyString, wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuRedo->SetBitmaps( wxArtProvider::GetBitmap( wxART_REDO, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuRedo->SetBitmap( wxArtProvider::GetBitmap( wxART_REDO, wxART_MENU ) );
#endif
	m_editMenu->Append( m_menuRedo );

	m_editMenu->AppendSeparator();

	wxMenuItem* m_menuCut;
	m_menuCut = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_CUT, wxString( wxT( "Cut" ) ) + wxT( '\t' ) + wxT( "Ctrl+X" ), wxEmptyString, wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuCut->SetBitmaps( wxArtProvider::GetBitmap( wxART_CUT, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuCut->SetBitmap( wxArtProvider::GetBitmap( wxART_CUT, wxART_MENU ) );
#endif
	m_editMenu->Append( m_menuCut );

	wxMenuItem* m_menuCopy;
	m_menuCopy = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_COPY, wxString( wxT( "Copy" ) ) + wxT( '\t' ) + wxT( "Ctrl+C" ), wxEmptyString, wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuCopy->SetBitmaps( wxArtProvider::GetBitmap( wxART_COPY, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuCopy->SetBitmap( wxArtProvider::GetBitmap( wxART_COPY, wxART_MENU ) );
#endif
	m_editMenu->Append( m_menuCopy );

	wxMenuItem* m_menuPaste;
	m_menuPaste = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_PASTE, wxString( wxT( "Paste" ) ) + wxT( '\t' ) + wxT( "Ctrl+V" ), wxEmptyString, wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuPaste->SetBitmaps( wxArtProvider::GetBitmap( wxART_PASTE, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuPaste->SetBitmap( wxArtProvider::GetBitmap( wxART_PASTE, wxART_MENU ) );
#endif
	m_editMenu->Append( m_menuPaste );

	wxMenuItem* m_menuDelete;
	m_menuDelete = new wxMenuItem( m_editMenu, MAIN_MENU_EDIT_DELETE, wxString( wxT( "Delete" ) ) + wxT( '\t' ) + wxT( "Del" ), wxEmptyString, wxITEM_NORMAL );
#ifdef __WXMSW__
	m_menuDelete->SetBitmaps( wxArtProvider::GetBitmap( wxART_DELETE, wxART_MENU ) );
#elif (defined( __WXGTK__ ) || defined( __WXOSX__ ))
	m_menuDelete->SetBitmap( wxArtProvider::GetBitmap( wxART_DELETE, wxART_MENU ) );
#endif
	m_editMenu->Append( m_menuDelete );

	m_mainMenu->Append( m_editMenu, wxT( "&Edit" ) );

	m_helpMenu = new wxMenu();
	wxMenuItem* m_menuHelpAbout;
	m_menuHelpAbout = new wxMenuItem( m_helpMenu, MAIN_MENU_ABOUT, wxString( wxT( "&About" ) ) + wxT( '\t' ) + wxT( "F1" ), wxT( "Show info about this application" ), wxITEM_NORMAL );
	m_helpMenu->Append( m_menuHelpAbout );

	m_mainMenu->Append( m_helpMenu, wxT( "&Help" ) );

	this->SetMenuBar( m_mainMenu );

	m_toolBarMain = this->CreateToolBar( wxTB_HORIZONTAL, MAIN_TOOLBAR );
	m_toolNew = m_toolBarMain->AddTool( MAIN_TOOLBAR_NEW, wxT( "New" ), wxArtProvider::GetBitmap( wxART_NEW, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT( "New file" ), wxT( "Creates a new resource file" ), NULL );

	m_toolOpen = m_toolBarMain->AddTool( MAIN_TOOLBAR_OPEN, wxT( "Open" ), wxArtProvider::GetBitmap( wxART_FILE_OPEN, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT( "Open file" ), wxT( "Open existing resource file" ), NULL );

	m_toolSave = m_toolBarMain->AddTool( MAIN_TOOLBAR_SAVE, wxT( "Save" ), wxArtProvider::GetBitmap( wxART_FILE_SAVE, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT( "Save file" ), wxT( "Save resource file" ), NULL );

	m_toolBarMain->AddSeparator();

	m_toolUndo = m_toolBarMain->AddTool( MAIN_TOOLBAR_UNDO, wxT( "Undo" ), wxArtProvider::GetBitmap( wxART_UNDO, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT( "Undo" ), wxT( "Undo the last action" ), NULL );

	m_toolRedo = m_toolBarMain->AddTool( MAIN_TOOLBAR_REDO, wxT( "Redo" ), wxArtProvider::GetBitmap( wxART_REDO, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxT( "Redo" ), wxT( "Redo the last action" ), NULL );

	m_toolBarMain->AddSeparator();

	m_toolCut = m_toolBarMain->AddTool( MAIN_TOOLBAR_CUT, wxT( "Cut" ), wxArtProvider::GetBitmap( wxART_CUT, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL );

	m_toolCopy = m_toolBarMain->AddTool( MAIN_TOOLBAR_COPY, wxT( "tool" ), wxArtProvider::GetBitmap( wxART_COPY, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL );

	m_toolPaste = m_toolBarMain->AddTool( MAIN_TOOLBAR_PASTE, wxT( "tool" ), wxArtProvider::GetBitmap( wxART_PASTE, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL );

	m_toolDelete = m_toolBarMain->AddTool( MAIN_TOOLBAR_DELETE, wxT( "tool" ), wxArtProvider::GetBitmap( wxART_DELETE, wxART_BUTTON ), wxNullBitmap, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL );

	m_toolBarMain->Realize();

	statusBar = this->CreateStatusBar( 2, wxST_SIZEGRIP, wxID_ANY );
	wxBoxSizer* bSizer;
	bSizer = new wxBoxSizer( wxHORIZONTAL );

	m_toolBar3 = new wxToolBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_DOCKABLE | wxTB_FLAT | wxTB_VERTICAL );
	m_toolSelect = m_toolBar3->AddTool( wxID_ANY, wxT( "Select" ), wxBitmap( wxT( "Resources/tool_select.png" ), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_RADIO, wxEmptyString, wxEmptyString, NULL );

	m_toolMove = m_toolBar3->AddTool( wxID_ANY, wxT( "Move" ), wxBitmap( wxT( "Resources/tool_move.png" ), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_RADIO, wxEmptyString, wxEmptyString, NULL );

	m_toolAddCircle = m_toolBar3->AddTool( wxID_ANY, wxT( "Add Circle" ), wxBitmap( wxT( "Resources/tool_add_circle.png" ), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_RADIO, wxEmptyString, wxEmptyString, NULL );

	m_toolAddPolygon = m_toolBar3->AddTool( wxID_ANY, wxT( "Add Polygon" ), wxBitmap( wxT( "Resources/tool_add_polygon.png" ), wxBITMAP_TYPE_ANY ), wxNullBitmap, wxITEM_RADIO, wxEmptyString, wxEmptyString, NULL );

	m_toolBar3->Realize();

	bSizer->Add( m_toolBar3, 0, wxEXPAND, 5 );

	m_splitter = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D );
	m_splitter->SetSashGravity( 1 );
	m_splitter->Connect( wxEVT_IDLE, wxIdleEventHandler( BaseMainFrame::m_splitterOnIdle ), NULL, this );

	m_splitter->SetMinSize( wxSize( 300, 100 ) );

	m_workFieldPanel = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxSize( 3, -1 ), wxWANTS_CHARS );
	m_workFieldPanel->SetBackgroundColour( wxColour( 255, 255, 255 ) );
	m_workFieldPanel->SetMinSize( wxSize( 200, 100 ) );

	m_propertyPanel = new wxPanel( m_splitter, wxID_ANY, wxDefaultPosition, wxSize( 1, -1 ), wxTAB_TRAVERSAL );
	m_propertyPanel->SetMinSize( wxSize( 100, 100 ) );

	wxBoxSizer* bPropertiesSizer;
	bPropertiesSizer = new wxBoxSizer( wxHORIZONTAL );

	m_propertyGrid = new wxPropertyGrid( m_propertyPanel, wxID_ANY, wxDefaultPosition, wxSize( 1, -1 ), wxPG_DEFAULT_STYLE | wxPG_SPLITTER_AUTO_CENTER );
	m_propertyGrid->SetMinSize( wxSize( 100, 100 ) );

	bPropertiesSizer->Add( m_propertyGrid, 1, wxEXPAND, 0 );

	m_propertyPanel->SetSizer( bPropertiesSizer );
	m_propertyPanel->Layout();
	m_splitter->SplitVertically( m_workFieldPanel, m_propertyPanel, 300 );
	bSizer->Add( m_splitter, 1, wxEXPAND, 5 );

	this->SetSizer( bSizer );
	this->Layout();

	// Connect Events
	this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BaseMainFrame::OnExit ) );
	this->Connect( m_menuFileNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnNew ) );
	this->Connect( m_menuFileOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnOpen ) );
	this->Connect( m_menuFileSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSave ) );
	this->Connect( m_menuFileSaveAs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSaveAs ) );
	this->Connect( m_menuFileClose->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnClose ) );
	this->Connect( m_menuFileQuit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnQuit ) );
	this->Connect( m_menuUndo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnUndo ) );
	this->Connect( m_menuRedo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnRedo ) );
	this->Connect( m_menuCut->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnCut ) );
	this->Connect( m_menuCopy->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnCopy ) );
	this->Connect( m_menuPaste->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnPaste ) );
	this->Connect( m_menuDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnDelete ) );
	this->Connect( m_menuHelpAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnAbout ) );
	this->Connect( m_toolNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnNew ) );
	this->Connect( m_toolOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnOpen ) );
	this->Connect( m_toolSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSave ) );
	this->Connect( m_toolUndo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnUndo ) );
	this->Connect( m_toolRedo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnRedo ) );
	this->Connect( m_toolCut->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnCut ) );
	this->Connect( m_toolCopy->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnCopy ) );
	this->Connect( m_toolPaste->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnPaste ) );
	this->Connect( m_toolDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnDelete ) );
	this->Connect( m_toolSelect->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnToolSelectSelected ) );
	this->Connect( m_toolMove->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnToolMoveSelected ) );
	this->Connect( m_toolAddCircle->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnToolCreateCircle ) );
	this->Connect( m_toolAddPolygon->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnToolCreatePolygon ) );
	m_workFieldPanel->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( BaseMainFrame::OnWorkPanelKeyDown ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_KEY_UP, wxKeyEventHandler( BaseMainFrame::OnWorkPanelKeyUp ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( BaseMainFrame::OnWorkPanelLmbDown ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( BaseMainFrame::OnWorkPanelLmbUp ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_MOTION, wxMouseEventHandler( BaseMainFrame::OnWorkPanelMouseMove ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( BaseMainFrame::OnWorkPanelMouseWheel ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_PAINT, wxPaintEventHandler( BaseMainFrame::OnWorkPanelPaint ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( BaseMainFrame::OnWorkPanelRmbDown ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( BaseMainFrame::OnWorkPanelRmbUp ), NULL, this );
	m_workFieldPanel->Connect( wxEVT_SIZE, wxSizeEventHandler( BaseMainFrame::OnWorkPanelSize ), NULL, this );
	m_propertyGrid->Connect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( BaseMainFrame::OnPropertyGridChanged ), NULL, this );
}

BaseMainFrame::~BaseMainFrame()
{
	// Disconnect Events
	this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BaseMainFrame::OnExit ) );
	this->Disconnect( MAIN_MENU_FILE_NEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnNew ) );
	this->Disconnect( MAIN_MENU_FILE_OPEN, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnOpen ) );
	this->Disconnect( MAIN_MENU_FILE_SAVE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSave ) );
	this->Disconnect( MAIN_MENU_FILE_SAVE_AS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSaveAs ) );
	this->Disconnect( MAIN_MENU_FILE_CLOSE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnClose ) );
	this->Disconnect( MAIN_MENU_FILE_QUIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnQuit ) );
	this->Disconnect( MAIN_MENU_EDIT_UNDO, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnUndo ) );
	this->Disconnect( MAIN_MENU_EDIT_REDO, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnRedo ) );
	this->Disconnect( MAIN_MENU_EDIT_CUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnCut ) );
	this->Disconnect( MAIN_MENU_EDIT_COPY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnCopy ) );
	this->Disconnect( MAIN_MENU_EDIT_PASTE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnPaste ) );
	this->Disconnect( MAIN_MENU_EDIT_DELETE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnDelete ) );
	this->Disconnect( MAIN_MENU_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnAbout ) );
	this->Disconnect( m_toolNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnNew ) );
	this->Disconnect( m_toolOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnOpen ) );
	this->Disconnect( m_toolSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnSave ) );
	this->Disconnect( m_toolUndo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnUndo ) );
	this->Disconnect( m_toolRedo->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnRedo ) );
	this->Disconnect( m_toolCut->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnCut ) );
	this->Disconnect( m_toolCopy->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnCopy ) );
	this->Disconnect( m_toolPaste->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnPaste ) );
	this->Disconnect( m_toolDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnDelete ) );
	this->Disconnect( m_toolSelect->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnToolSelectSelected ) );
	this->Disconnect( m_toolMove->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnToolMoveSelected ) );
	this->Disconnect( m_toolAddCircle->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnToolCreateCircle ) );
	this->Disconnect( m_toolAddPolygon->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( BaseMainFrame::OnToolCreatePolygon ) );
	m_workFieldPanel->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( BaseMainFrame::OnWorkPanelKeyDown ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_KEY_UP, wxKeyEventHandler( BaseMainFrame::OnWorkPanelKeyUp ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( BaseMainFrame::OnWorkPanelLmbDown ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( BaseMainFrame::OnWorkPanelLmbUp ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_MOTION, wxMouseEventHandler( BaseMainFrame::OnWorkPanelMouseMove ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( BaseMainFrame::OnWorkPanelMouseWheel ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_PAINT, wxPaintEventHandler( BaseMainFrame::OnWorkPanelPaint ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( BaseMainFrame::OnWorkPanelRmbDown ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( BaseMainFrame::OnWorkPanelRmbUp ), NULL, this );
	m_workFieldPanel->Disconnect( wxEVT_SIZE, wxSizeEventHandler( BaseMainFrame::OnWorkPanelSize ), NULL, this );
	m_propertyGrid->Disconnect( wxEVT_PG_CHANGED, wxPropertyGridEventHandler( BaseMainFrame::OnPropertyGridChanged ), NULL, this );

}
